package com.cn.serverline.lineicp.produce.controller;


import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import com.cn.serverline.lineicp.produce.entity.dto.TeExceptionDto;
import com.cn.serverline.lineicp.produce.entity.vo.TeExceptionVo;
import com.cn.serverline.lineicp.produce.service.ITeExceptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 异常类型 前端控制器
 * </p>
 *
 * @author 王凯炫
 * @since 2024-08-22
 */
@RestController
@RequestMapping("/exception")
@Api(tags = "异常类型")
@ApiResource(name = "异常类型")
public class TeExceptionController {

    @Resource(name = "teExceptionServiceImpl")
    private ITeExceptionService teExceptionService;

    /**
     * 查询异常类型
     * @param teExceptionDto
     * @return
     */
    @PostMapping("/sel")
    @ApiOperation(value = "异常类型")
    public ResponseData<List<TeExceptionVo>> sel(@RequestBody @Validated TeExceptionDto teExceptionDto) {
        return new SuccessResponseData<>(teExceptionService.sel(teExceptionDto));
    }

}
